home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc20 / gemfast.h < prev    next >
C/C++ Source or Header  |  1992-02-06  |  12KB  |  504 lines

  1. #ifndef _GEMFAST_H
  2. #define _GEMFAST_H
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. /**************************************************************************
  9.  *
  10.  * GEMFAST.H - Header file for common VDI and AES symbols.    
  11.  *
  12.  *  This header file contains items compatible with both GEMDEFS and OBDEFS
  13.  *  from the Alcyon system.  Note that there are no 'extern' definitions
  14.  *  for the functions, because they all return a signed short and work
  15.  *  fine as autodefined functions.
  16.  *
  17.  *  If you have a lot of source already coded for #include <gemdefs.h>,
  18.  *  you can continue to use your original gemdefs file, or you can rename
  19.  *  this file to gemdefs.h; if your source also includes obdefs.h, remove
  20.  *  them when using this file.
  21.  *  (i have links called obdefs and gemdefs, since this file is now protected
  22.  *   against multiple inclusions -- ++jrb)
  23.  *
  24.  * Credits dept:
  25.  *    This file bears an amazing similarity to the original Alcyon GEMDEFS
  26.  *    and OBDEFS header files, which are copyrighted by Atari.  What can I
  27.  *    say?  Copyrighted or not, these are the names and values that every-
  28.  *    body uses, so of course the files look *awful* similar...
  29.  *
  30.  *************************************************************************/
  31.  
  32.         /* evnt_multi flags */
  33. #define MU_KEYBD    0x0001
  34. #define MU_BUTTON    0x0002
  35. #define MU_M1        0x0004
  36. #define MU_M2        0x0008
  37. #define MU_MESAG    0x0010
  38. #define MU_TIMER    0x0020
  39.         /* keyboard states */
  40. #define K_RSHIFT    0x0001
  41. #define K_LSHIFT    0x0002
  42. #define K_CTRL         0x0004
  43. #define K_ALT        0x0008
  44.         /* event message values */
  45. #define MN_SELECTED    10
  46. #define WM_REDRAW    20
  47. #define WM_TOPPED    21
  48. #define WM_CLOSED    22
  49. #define WM_FULLED    23
  50. #define WM_ARROWED    24
  51. #define WM_HSLID    25
  52. #define WM_VSLID    26
  53. #define WM_SIZED    27
  54. #define WM_MOVED    28
  55. #define WM_NEWTOP    29
  56. #define AC_OPEN        40
  57. #define AC_CLOSE    41
  58.         /* form_dial opcodes */
  59. #define FMD_START    0
  60. #define FMD_GROW    1
  61. #define FMD_SHRINK    2
  62. #define FMD_FINISH    3
  63.         /* rsrc_gaddr structure types */
  64. #define R_TREE         0 
  65. #define R_OBJECT    1
  66. #define R_TEDINFO    2
  67. #define R_ICONBLK    3
  68. #define R_BITBLK    4
  69. #define R_STRING    5
  70. #define R_IMAGEDATA 6
  71. #define R_OBSPEC    7
  72. #define R_TEPTEXT    8
  73. #define R_TEPTMPLT    9
  74. #define R_TEPVALID    10
  75. #define R_IBPMASK    11 
  76. #define R_IBPDATA    12    
  77. #define R_IBPTEXT    13
  78. #define R_BIPDATA    14
  79. #define R_FRSTR        15
  80. #define R_FRIMG        16 
  81.         /* Window Attributes */
  82. #define NAME        0x0001
  83. #define CLOSER         0x0002
  84. #define FULLER         0x0004
  85. #define MOVER        0x0008
  86. #define INFO        0x0010
  87. #define SIZER        0x0020
  88. #define UPARROW        0x0040
  89. #define DNARROW        0x0080
  90. #define VSLIDE         0x0100
  91. #define LFARROW        0x0200
  92. #define RTARROW        0x0400
  93. #define HSLIDE         0x0800
  94.         /* wind_create flags */
  95. #define WC_BORDER    0
  96. #define WC_WORK        1
  97.         /* wind_get flags */
  98. #define WF_KIND         1
  99. #define WF_NAME         2
  100. #define WF_INFO         3
  101. #define WF_WORKXYWH      4
  102. #define WF_CURRXYWH     5
  103. #define WF_PREVXYWH      6
  104. #define WF_FULLXYWH      7
  105. #define WF_HSLIDE    8
  106. #define WF_VSLIDE    9
  107. #define WF_TOP          10
  108. #define WF_FIRSTXYWH     11
  109. #define WF_NEXTXYWH      12
  110. #define WF_RESVD    13
  111. #define WF_NEWDESK    14
  112. #define WF_HSLSIZE    15
  113. #define WF_VSLSIZE    16
  114. #define WF_SCREEN    17
  115.         /* arrow message    */
  116. #define WA_UPPAGE     0
  117. #define WA_DNPAGE     1
  118. #define WA_UPLINE     2
  119. #define WA_DNLINE     3
  120. #define WA_LFPAGE     4
  121. #define WA_RTPAGE     5
  122. #define WA_LFLINE     6
  123. #define WA_RTLINE     7
  124.  
  125.         /* wind_update flags */
  126. #define END_UPDATE    0
  127. #define BEG_UPDATE    1
  128. #define END_MCTRL    2
  129. #define BEG_MCTRL    3
  130.         /* graf_mouse mouse types*/
  131. #define ARROW        0
  132. #define BEE        2
  133. #define BUSY_BEE    BEE        /* alias */
  134. #define TEXT_CRSR    1
  135. #define HOURGLASS    2
  136. #define POINT_HAND    3
  137. #define FLAT_HAND    4
  138. #define THIN_CROSS    5
  139. #define THICK_CROSS    6
  140. #define OUTLN_CROSS     7
  141. #define USER_DEF    255
  142. #define M_OFF        256
  143. #define M_ON        257
  144.         /* objects - general */
  145. #define ROOT 0                /* index of ROOT            */
  146. #define MAX_LEN     81        /* max string length        */
  147. #define MAX_DEPTH    8        /* max depth of search or draw  */
  148.         /* inside fill patterns    */
  149. #define IP_HOLLOW    0
  150. #define IP_1PATT    1
  151. #define IP_2PATT    2
  152. #define IP_3PATT    3
  153. #define IP_4PATT    4
  154. #define IP_5PATT    5
  155. #define IP_6PATT    6
  156. #define IP_SOLID    7
  157.         /* normal graphics drawing modes */
  158. #define MD_REPLACE    1
  159. #define MD_TRANS    2
  160. #define MD_XOR         3
  161. #define MD_ERASE    4
  162.  
  163.         /* bit blt rules */
  164. #define ALL_WHITE    0
  165. #define S_AND_D        1
  166. #define S_AND_NOTD    2
  167. #define S_ONLY         3
  168. #define NOTS_AND_D    4
  169. #define D_ONLY         5
  170. #define S_XOR_D        6
  171. #define S_OR_D         7
  172. #define NOT_SORD    8
  173. #define NOT_SXORD    9
  174. #define D_INVERT    10
  175. #define NOT_D        10
  176. #define S_OR_NOTD    11
  177. #define NOT_S        12
  178. #define NOTS_OR_D    13
  179. #define NOT_SANDD    14
  180. #define ALL_BLACK    15
  181.  
  182.         /* font types */
  183. #define IBM 3
  184. #define SMALL 5
  185.  
  186.         /* object types */
  187. #define G_BOX        20
  188. #define G_TEXT         21
  189. #define G_BOXTEXT    22
  190. #define G_IMAGE        23
  191. #define G_USERDEF    24
  192. #define G_IBOX         25
  193. #define G_BUTTON    26
  194. #define G_BOXCHAR    27
  195. #define G_STRING    28
  196. #define G_FTEXT        29
  197. #define G_FBOXTEXT    30
  198. #define G_ICON         31
  199. #define G_TITLE        32
  200.         /* object flags */
  201. #define NONE        0x0000
  202. #define SELECTABLE    0x0001
  203. #define DEFAULT        0x0002
  204. #define EXIT        0x0004
  205. #define EDITABLE    0x0008
  206. #define RBUTTON        0x0010
  207. #define LASTOB         0x0020
  208. #define TOUCHEXIT    0x0040
  209. #define HIDETREE    0x0080
  210. #define INDIRECT    0x0100
  211.         /* Object states */
  212. #define NORMAL         0x0000
  213. #define SELECTED    0x0001
  214. #define CROSSED        0x0002
  215. #define CHECKED        0x0004
  216. #define DISABLED    0x0008
  217. #define OUTLINED    0x0010
  218. #define SHADOWED    0x0020
  219.         /* Object colors - default pall. */
  220. #define WHITE    0
  221. #define BLACK    1
  222. #define RED      2
  223. #define GREEN    3
  224. #define BLUE     4
  225. #define CYAN     5
  226. #define YELLOW   6
  227. #define MAGENTA  7
  228. #define LWHITE   8
  229. #define LBLACK   9
  230. #define LRED     10
  231. #define LGREEN   11
  232. #define LBLUE    12
  233. #define LCYAN    13
  234. #define LYELLOW  14
  235. #define LMAGENTA 15
  236.         /* editable text field definitions */
  237. #define EDSTART        0
  238. #define EDINIT         1
  239. #define EDCHAR         2
  240. #define EDEND        3
  241.         /* editable text justification */
  242. #define TE_LEFT        0
  243. #define TE_RIGHT    1
  244. #define TE_CNTR        2
  245.  
  246.         /* file attr for dos_create    */
  247. #define    F_ATTR        0    
  248.  
  249.         /* VDI Memory Form Definition Block */
  250.  
  251. #ifndef __MFDB__
  252. #ifndef _ALT_MFDB
  253. #ifndef __ALT_MFDB__
  254.  
  255. #define __MFDB__
  256.  
  257. typedef struct
  258. {
  259.     long        fd_addr;    /* Addrerss of upper left corner of first*/
  260.                                     /* plane of raster area. If NULL then   */
  261.                                     /* MFDB is for a physical device        */
  262.     short        fd_w;        /* Form Width in Pixels                 */
  263.     short        fd_h;       /* Form Height in Pixels                */
  264.     short        fd_wdwidth; /* Form Width in shorts(fd_w/sizeof(int)*/
  265.     short        fd_stand;   /* Form format 0= device spec 1=standard*/
  266.     short        fd_nplanes; /* Number of memory planes              */
  267.     short        fd_r1;      /* Reserved                             */
  268.     short        fd_r2;      /* Reserved                             */
  269.     short        fd_r3;      /* Reserved                             */
  270. } MFDB;
  271. #endif
  272. #endif
  273. #endif    /* __MFDB__ */
  274.  
  275. #ifdef __ALT_MFDB__
  276. /* some software seems to wants this format for FDB. to get it, define
  277.    __ALT_MFDB__
  278.  */
  279. #ifdef __MFDB__
  280. # error conflicting types for MFDB
  281. #endif
  282.  
  283. #define __MFDB__
  284. typedef struct
  285. {
  286.     long    mp;
  287.     short    fwp;
  288.     short    fh;
  289.     short    fww;
  290.     short    ff;
  291.     short    np;
  292.     short    r1;
  293.     short    r2;
  294.     short    r3;
  295. } MFDB;
  296. #endif /* __ALT_MFDB__ */
  297.  
  298.         /* Mouse Form Definition Block */
  299. typedef struct mouse_form
  300.     {
  301.     short    mf_xhot;
  302.     short     mf_yhot;
  303.     short     mf_nplanes;
  304.     short    mf_bg;
  305.     short     mf_fg;
  306.     short     mf_mask[16];
  307.     short     mf_data[16];
  308.     } MFORM ;
  309.  
  310. typedef struct mouse_event_type
  311.     {
  312.     int    *x;
  313.     int     *y;
  314.     int    *b;
  315.     int    *k;
  316.     } Mouse;
  317.  
  318. typedef struct graphic_rectangle
  319.     {    /* note these three rect structs are deliberately ints */
  320.     int g_x;
  321.     int g_y;
  322.     int g_w;
  323.     int g_h;
  324.     } GRECT;
  325.  
  326. typedef struct vdi_rectangle
  327.     {
  328.     int v_x1;
  329.     int v_y1;
  330.     int v_x2;
  331.     int v_y2;
  332.     } VRECT;
  333.  
  334. typedef struct orect
  335. {
  336.         struct orect    *o_link;
  337.     int    o_x;
  338.     int    o_y;
  339.     int    o_w;
  340.     int    o_h;
  341. } ORECT;
  342.  
  343. typedef struct rect_for_rect_utils
  344.     {    /* note these three rect structs are deliberately ints */
  345.     int x;
  346.     int y;
  347.     int w;
  348.     int h;
  349.     } Rect;
  350.  
  351. typedef struct text_edinfo
  352.     {
  353.     char *te_ptext;            /* ptr to text             */
  354.     char *te_ptmplt;        /* ptr to template            */
  355.     char *te_pvalid;        /* ptr to validation chrs.   */
  356.     short    te_font;        /* font                    */
  357.     short    te_junk1;         /* junk word                */
  358.     short    te_just;        /* justification            */
  359.     short    te_color;         /* color information word    */
  360.     short    te_junk2;         /* junk word                */
  361.     short    te_thickness;        /* border thickness         */
  362.     short    te_txtlen;        /* length of text string     */
  363.     short    te_tmplen;        /* length of template string */
  364.     } TEDINFO;
  365.  
  366. typedef struct icon_block
  367.     {
  368.     short    *ib_pmask;
  369.     short    *ib_pdata;
  370.     char     *ib_ptext;
  371.     short    ib_char;
  372.     short    ib_xchar;
  373.     short    ib_ychar;
  374.     short    ib_xicon;
  375.     short    ib_yicon;
  376.     short    ib_wicon;
  377.     short    ib_hicon;
  378.     short    ib_xtext;
  379.     short    ib_ytext;
  380.     short    ib_wtext;
  381.     short    ib_htext;
  382.         short   ib_resvd;
  383.     } ICONBLK;
  384.  
  385. typedef struct bit_block
  386.     {
  387.     char     *bi_pdata;            /* ptr to bit forms data  */
  388.     short    bi_wb;                /* width of form in bytes */
  389.     short    bi_hl;                /* height in lines */
  390.     short    bi_x;                /* source x in bit form     */
  391.     short    bi_y;                /* source y in bit form     */
  392.     short    bi_color;             /* fg color of blt */
  393.  
  394.     } BITBLK;
  395.  
  396. typedef struct user_block
  397.     {
  398.         int  (*ub_code)(void *parmblock); /* really PARMBLK *parmblock */
  399.     long ub_parm;
  400.     } USERBLK;
  401.  
  402. #ifndef __TCC_COMPAT__
  403. typedef struct object
  404.     {
  405.     short    ob_next;    /* -> object's next sibling            */
  406.     short    ob_head;    /* -> head of object's children       */
  407.     short    ob_tail;    /* -> tail of object's children       */
  408.     unsigned short ob_type;    /* type of object              */
  409.     unsigned short ob_flags;/* flags                  */
  410.     unsigned short ob_state;/* state                  */
  411.     unsigned long  ob_spec;    /* object-specific data              */
  412.     short    ob_x;        /* upper left corner of object           */
  413.     short    ob_y;        /* upper left corner of object           */
  414.     short    ob_width;     /* width of obj                  */
  415.     short    ob_height;    /* height of obj              */
  416.     } OBJECT;
  417. #else
  418.  
  419. typedef struct {
  420.     unsigned short character   :  8;
  421.     signed   short framesize   :  8;
  422.     unsigned short framecol    :  4;
  423.     unsigned short textcol     :  4;
  424.     unsigned short textmode    :  1;
  425.     unsigned short fillpattern :  3;
  426.     unsigned short interiorcol :  4;
  427. } bfobspec;
  428.  
  429. typedef union __u_ob_spec {
  430.     TEDINFO        *tedinfo;
  431.     long        index;
  432.     char        *free_string;
  433.     union __u_ob_spec *indirect;
  434.         bfobspec    obspec;
  435.     BITBLK        *bitblk;
  436.     ICONBLK        *iconblk;
  437.         USERBLK     *userblk;
  438. /*    APPLBLK        *applblk;
  439.     char        *string;    */
  440. } U_OB_SPEC;
  441.  
  442. typedef struct object
  443.     {
  444.     short    ob_next;    /* -> object's next sibling            */
  445.     short    ob_head;    /* -> head of object's children       */
  446.     short    ob_tail;    /* -> tail of object's children       */
  447.     unsigned short ob_type;    /* type of object              */
  448.     unsigned short ob_flags;/* flags                  */
  449.     unsigned short ob_state;/* state                  */
  450.     U_OB_SPEC      ob_spec;    /* object-specific data              */
  451.     short    ob_x;        /* upper left corner of object           */
  452.     short    ob_y;        /* upper left corner of object           */
  453.     short    ob_width;     /* width of obj                  */
  454.     short    ob_height;    /* height of obj              */
  455.     } OBJECT;
  456. #endif
  457.  
  458. typedef struct parm_block
  459.     {
  460.     OBJECT     *pb_tree;
  461.     short    pb_obj;
  462.     short    pb_prevstate;
  463.     short    pb_currstate;
  464.     short    pb_x, pb_y, pb_w, pb_h;
  465.     short    pb_xc, pb_yc, pb_wc, pb_hc;
  466.     long     pb_parm;
  467.     } PARMBLK;
  468.  
  469.                         /* used in RSCREATE.C    */
  470. typedef struct rshdr
  471. {
  472.     short        rsh_vrsn;
  473.     unsigned short    rsh_object;
  474.     unsigned short    rsh_tedinfo;
  475.     unsigned short    rsh_iconblk;    /* list of ICONBLKS        */
  476.     unsigned short    rsh_bitblk;
  477.     unsigned short    rsh_frstr;    
  478.     unsigned short    rsh_string;
  479.     unsigned short    rsh_imdata;    /* image data            */
  480.     unsigned short    rsh_frimg;    
  481.     unsigned short    rsh_trindex;
  482.     short        rsh_nobs;    /* counts of various structs    */
  483.     short        rsh_ntree;
  484.     short        rsh_nted;
  485.     short        rsh_nib;
  486.     short        rsh_nbb;
  487.     short        rsh_nstring;
  488.     short        rsh_nimages;
  489.     unsigned short    rsh_rssize;    /* total bytes in resource    */
  490. } RSHDR;
  491.  
  492. #define DESKTOP_HANDLE 0
  493.  
  494. /* (user visible) binding arrays */
  495. extern short         _intin[], _intout[], _ptsin[], _ptsout[];
  496. extern void          *_addrin[], *_addrout[];
  497. extern int        gl_apid, gl_ap_version;
  498.  
  499. #ifdef __cplusplus
  500. }
  501. #endif
  502.  
  503. #endif /* _GEMFAST_H */
  504.